<!--清算账户余额警戒值通知报文查询页面-->
<template>
  <div class="app-container">
    <ht-search-form
      v-show="showSearch"
      :dictMap="dictMap"
      :queryParams="queryParams"
      :outputQueryParams="queryParams"
      :formOptions="formOptions"
      :advOptions="[]"
    ></ht-search-form>
    <ht-table
      ref="dataTable"
      :showSerialNumber="false"
      :multi-select="false"
      :dictMap="dictMap"
      :reqConfig="reqConfig"
      :queryParams="queryParams"
      :tableBindColumns="tableBindColumns"
      :opButtonList="opButtonList"
    >
      <template v-slot:operate>
        <el-table-column
          label="操作"
          align="center"
          width="120"
          fixed="right"
          class-name="small-padding fixed-width"
        >
          <template slot-scope="scope">
            <ht-button-group
              :buttonList="[
            {
            label: '明细',
            // permission: 'user:xxx:xxx',
            doFunc: () => {
            handleAction('detials', scope.row);
            }
            }
            ]"
            />
          </template>
        </el-table-column>
      </template>
    </ht-table>
    <!-- 明细弹出框 -->
    <inform-details ref="informDetailsDialog" :dictMap="dictMap" :formData.sync="formData"></inform-details>
  </div>
</template>
<script>
import { apiUrlConfig } from "@/api/cnaps/nets/AcctLimtWarn/setting_inform_query.js";
import InformDetails from "./components/informDetails";
import { listPageMixin } from "@/libs/listPageMixin";
import { log } from "util";

export default {
  name: "settingInformQuery",
  mixins: [listPageMixin],
  components: {
    InformDetails
  },
  data() {
    return {
      reqConfig: apiUrlConfig,
      total: 0,
      dataList: [],
      //数据字典
      searchFormDictList: [
        "WARNINGTYPECODE",
        "PKG_STATUS",
        "PROCESSSTATUS",
        "SYSTEMCODE",
        "PLUSMINUSTYPECODE"
      ],
      //  明细弹框数据
      // form表单字段
      formData: {
        id: "",
        pkgId: "",
        workDate: "",
        directSender: "",
        senderName: "",
        directReciver: "",
        reciverName: "",
        setStBrno: "",
        stBrName: "",
        warnType: "",
        warnCurcd: "",
        currentPmFlag: "",
        currentValue: "",
        warnPmFlag: "",
        currentCurcd: "",
        warnValue: "",
        remarks: "",
        rcvTime: ""
      },
      showSearch: true,
      // 查询参数
      queryParams: {
        id2: "",
        vdate: "",
        vdate1: "",
        workdate: "",
        workdate2: ""
      },
      formOptions: [],
      opButtonList: () => {
        return [];
      },
      tableBindColumns: [
        { label: `交易流水号`, prop: "id", width: "170", sortable: false },
        {
          label: `CPG日期`,
          prop: "vdate",
          width: "100",
          sortable: false,
          type: "date"
        },
        {
          label: `工作日期`,
          prop: "workDate",
          width: "160",
          sortable: false,
          type: "date"
        },
        {
          label: `发起参与机构号`,
          prop: "directSender",
          width: "160",
          sortable: false
        },
        {
          label: `被监视清算行行号`,
          prop: "setStBrno",
          width: "160",
          sortable: false
        },
        {
          label: `预警通知类型`,
          prop: "warnType",
          width: "100",
          dictCode: "WARNINGTYPECODE",
          sortable: false
        },
        {
          label: `报文接收时间`,
          prop: "rcvTime",
          type: "date",
          sortable: false
        },
        {
          label: `接收到参与机构号`,
          prop: "directReciver",
          width: "160",
          sortable: false
        },
        {
          label: `接收参与机构名`,
          prop: "reciverName",
          width: "160",
          sortable: false
        }
      ]
    };
  },
  mounted() {
    this.formOptions = [
      {
        type: "input",
        prop: "id2",
        defaultAttr: {
          label: "交易流水号",
          placeholder: "请输入交易流水号"
        }
      },
      {
        type: "dates",
        nameObj: {
          startTimeName: "workdate",
          endTimeName: "workdate2"
        },
        defaultAttr: {
          label: "CPG日期",
          placeholder: ["请输入开始日期", "请输入结束日期"],
          format: "yyyy-MM-dd",
          valueFormat: "yyyyMMdd"
        }
      },
      {
        type: "dates",
        nameObj: {
          startTimeName: "vdate",
          endTimeName: "vdate1"
        },
        defaultAttr: {
          label: "工作日期",
          placeholder: ["请输入开始日期", "请输入结束日期"],
          format: "yyyy-MM-dd",
          valueFormat: "yyyyMMdd"
        }
      }
    ];
  },
  methods: {
    editComplete(state) {
      if (state == true) {
      }
    },
    handleAction(type, row = {}) {
      switch (type) {
        case "detials":
          // 明细信息
          this.formData = _.clone(row);
          if (this.formData.directSender === "0000") {
            this.$set(this.formData, "senderName", "中心");
          }
          if (this.formData.directReciver === "0000") {
            this.$set(this.formData, "reciverName", "中心");
          }
          if (this.formData.setStBrno === "0000") {
            this.$set(this.formData, "stBrName", "中心");
          }
          this.$refs.informDetailsDialog.show();
          break;
      }
    }
  }
};
</script>
<style>
.label-header-msg {
  font-weight: bold;
}
</style>
